workhorse:verify:
  extends: .workhorse:rules:workhorse
  image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}golang:${GO_VERSION}
  stage: test
  needs: []
  script:
    - go version
    - make -C workhorse  # test build
    - make -C workhorse verify

.workhorse:test:
  extends: .workhorse:rules:workhorse
  image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}-golang-${GO_VERSION}-rust-${RUST_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-2.36-exiftool-12.60
  variables:
    GITALY_ADDRESS: "tcp://127.0.0.1:8075"
  stage: test
  needs:
    - setup-test-env
  before_script:
    - source scripts/utils.sh
    - export BUNDLE_WITHOUT="${BUNDLE_WITHOUT}:default:test:puma:kerberos:metrics:omnibus:ed25519"
    - bundle_install_script
    - go version
    - scripts/gitaly-test-build
  script:
    - make -C workhorse test

workhorse:test go:
  extends: .workhorse:test
  parallel:
    matrix:
      - GO_VERSION: ["1.18", "1.19", "1.20"]
  script:
    - make -C workhorse test-coverage
  coverage: '/\d+.\d+%/'
  artifacts:
    expire_in: 30 days
    paths:
      - workhorse/coverage.html

workhorse:test fips:
  extends: .workhorse:test
  parallel:
    matrix:
      - GO_VERSION: ["1.18", "1.19", "1.20"]
  image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/ubi-${UBI_VERSION}-ruby-${RUBY_VERSION}-golang-${GO_VERSION}-rust-${RUST_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-2.36-exiftool-12.60
  variables:
    FIPS_MODE: 1

workhorse:test race:
  extends: .workhorse:test
  script:
    - make -C workhorse test-race
